<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('消息中心列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>当前时间：</label>
                            <input type="text" name="cd" id="nowDate"/>
                        </li>
                        <li>
                            <label>键值对：</label>
                            <input type="text" name="na" id="dbSize"/>
                        </li>
                        <li>
                            <label>内存(M)：</label>
                            <input type="text" name="euLevel" id="memary"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="refresh()"><i class="fa fa-search"></i>刷新</a>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="removeAll()"><i class="fa fa-search"></i>清空</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="col-sm-12 " >
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>折叠面板</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                            <i class="fa fa-wrench"></i>
                        </a>
                        <ul class="dropdown-menu dropdown-user">
                            <li><a href="#">选项1</a>
                            </li>
                            <li><a href="#">选项2</a>
                            </li>
                        </ul>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="panel-body">
                        <div class="panel-group" id="accordion">
                            <div class="panel panel-default">
                                <div class="panel-heading">
                                    <h5 class="panel-title">
                                        <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">维度数据</a>
                                    </h5>
                                </div>
                                <div id="collapseOne" class="panel-collapse collapse in">
                                    <div class="panel-body" id="dimData">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var prefix = ctx + "system/redis";
    function refresh() {
        $.ajax({
            url: prefix+'/msgUse',
            type: 'get',
            success: function (data) {
                $("#nowDate").val(data.dateTime);
                $("#memary").val(data.memary+"M");
                $("#dbSize").val(data.dbSize);
                $("#dimData").html(data.dimData);
            }
        });
    }
    function removeAll() {
        $.ajax({
            url: prefix+'/deleteAll',
            type: 'get',
            success: function (data) {
                $.modal.alertSuccess("已清空");
            }
        });
    }
    $(function () {
        refresh();
    });
</script>
</body>
</html>